package com.na.qwr;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 * @Author: Qingwr
 * @Date: 2022/8/13 21:59
 * @Description //TODO 文件描述
 */
public class OrderMapper extends Mapper<LongWritable, Text, Text, LongWritable> {

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String[] strs = value.toString().split("\t");
        //取订单编号为Key, 金额为value
        context.write(new Text(strs[0]), new LongWritable(new Long(strs[2])));
    }
}
